package cn.com.simple.learning.rabbitmq.mq.consumer;

import cn.com.simple.learning.rabbitmq.config.StreamDelayPipeline;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;

import java.time.LocalDateTime;

/**
 * @author Jianxing.Jia
 * @date 2022/5/25
 * @description 描述信息
 */
@Slf4j
@EnableBinding(StreamDelayPipeline.class)
public class MyConsumer {

    @StreamListener(StreamDelayPipeline.RECV)
    public void recv(@Payload String message) {

        log.info("接收到消息,{},当前时间为,{}", message, LocalDateTime.now());
    }

}
